<script setup>
import { defineProps, defineEmits } from 'vue'

const props = defineProps({
  paginationData: Object
})
const emits = defineEmits(['sizeChange', 'currentChange'])

// 切换页面大小
const handleSizeChange = (value) => {
  emits('sizeChange', value)
}

// 切换页码
const handleCurrentChange = (value) => {
  emits('currentChange', value)
}
</script>
<template>
  <el-pagination
    :current-page="props.paginationData.currentPage"
    :page-size="props.paginationData.pageSize"
    :page-sizes="props.paginationData.pageSizes"
    :size="props.paginationData.size"
    :layout="props.paginationData.layout"
    :total="props.paginationData.total"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
  />
</template>
<style scoped></style>
